﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="_Cart.aspx.cs" Inherits="eCommerce.cms.Controls.Cart" %>
<%@ Import Namespace="eCommerce.core.Helpers" %>

<form id="form1" runat="server">

    <table width="100%" cellspacing="0" cellpadding="0" class="tableStatic">
        <thead>
            <tr>
                <td class="w45">STT</td>
                <td class="w140"></td>
                <td>Mã & Tên sản phẩm</td>
                <td class="w80">Số lượng</td>        
                <td>Giá (VND)</td>
                <td>Giảm giá (VND)</td>                
                <td>Thành tiền</td>                                
            </tr>
        </thead>
        <tbody>
            <asp:ListView ID="lvShoppingCart" DataKeyNames="ProductId" OnItemDataBound="lvShoppingCart_ItemDataBound" runat="server">
            <LayoutTemplate>
                <tr id="itemPlaceHolder" runat="server"></tr>
            </LayoutTemplate>    
            <ItemTemplate>
                <asp:HiddenField ID="hfProductId" Value='<%#Eval("ProductId")%>' runat="server"/>                        
                <asp:HiddenField ID="hfUnitPrice" Value='<%#Eval("UnitPrice")%>' runat="server"/>    
                <tr>
                    <td class="aligncenter"><%# Container.DataItemIndex + 1 %></td>
                    <td class="aligncenter"><img src="/Thumb.ashx?ProductId=<%# Eval("ProductID") %>&Size=135" alt=""/></td>        
                    <td><%# Eval("Name") %></td>                                                                                                                                      
                    <td class="aligncenter"><asp:Literal ID="ltTotalQuantity" Text="-" runat="server"/></td>
                    <td class="alignright"><%# Utils.FormatPrice(Utils.ToDecimal(Eval("UnitPrice")))%></td>
                    <td class="alignright"><%# Utils.FormatPrice(Utils.ToDecimal(Eval("SpecialPrice")))%></td>                    
                    <td class="alignright"><asp:Literal ID="ltTotalItemValue" Text="-" runat="server"/></td>                    
                </tr>
                <tr>
                    <td colspan="8">
                        <span class="mr10"><asp:Literal ID="ltSize" runat="server" /></span>
                        <asp:Repeater ID="rptSize" runat="server">                                            
                            <ItemTemplate>                          
                                <asp:HiddenField ID="hfSizeId" Value='<%# Eval("SizeId") %>' runat="server"/>       
                                <asp:HiddenField ID="hfSizeName" Value='<%# Eval("Name") %>' runat="server"/>
                                <strong class="green"><%# Eval("Name") %></strong>
                                <asp:TextBox ID="txtQuantity" Width="30" Text="0" CssClass="alignright mr5 ml5 onlyNums validate[required,custom[integer],min[0]]" runat="server" />
                            </ItemTemplate>
                        </asp:Repeater>
                    </td>   
                </tr>
            </ItemTemplate>
            <EmptyDataTemplate>        
                <tr>
                    <td colspan="8">Không có sản phẩm nào :P</td>
                </tr>
            </EmptyDataTemplate>
            </asp:ListView>    
        
            <asp:Literal ID="ltDiscount" runat="server"/>                
            <asp:Literal ID="ltTotalOrder" runat="server"/>
            <asp:Literal ID="ltTotalValue" runat="server"/>
            <asp:Literal ID="ltFreight" runat="server"/>
        </tbody>
    </table>

</form>
